<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <h2>小黑记事本</h2>
    <div id="note">
        <input v-model:value="insertText" placeholder="请输入"/><button @click="add(insertText)">添加任务</button>
        <ul>
            <li v-for="(item,key) in textList" :key="key">{{item}}</li>
        </ul>
    </div>
    <script src="../vue.js"></script>
    <script>
        const vue = new Vue({
            el: '#note',
            data: {
                insertText:'',
                textList: []
            },
            methods:{
                add(event){
                    this.textList.push(event)
                }
            }
        });
    </script>
</body>
</html>